<%@page import="java.sql.Date"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'updateUser.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>


</head>
<%
	int userId = Integer.valueOf(request.getParameter("id"));
	String username = request.getParameter("uname");
	String passwd = request.getParameter("upwd");
	String role = request.getParameter("role");
%>
<body>
	<div class="panel admin-panel margin-top">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>修改用户信息</strong>
		</div>
		<div class="body-content">
			<form action="UpdateUserServlet" class="form-x"
				onsubmit="return check(this)" method="GET">

				<div class="form-group">
					<div class="label">
						<label>管理员类型:</label>
					</div>
					<div class="field">
						<select name="role" class="input w50">
							<option value="2" selected=<%=role.equals(2) ? "selected" : ""%>>普通管理员</option>
							<option value="1" selected=<%=role.equals(1) ? "selected" : ""%>>超级管理员</option>
						</select>
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>用户名:</label>
					</div>
					<div class="field">
						<input type="text" disabled="disabled" value="<%=username%>" class="input w50"
							name="uname">
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>密码:</label>
					</div>
					<div class="field">
						<input type="text" name="upwd" class="input w50"
							value="<%=passwd%>">
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
				<div class="label">
					<label></label>
				</div>
				<div class="field">

					<button type="submit" class="button bg-main icon-check-square-o">修改</button>

					<button type="button" class="button bg-main icon-minus-circle"
						value="取消" 
						onclick="window.location.href='userlist.jsp'">取消</button>
				</div>
				</div>


				<input type="hidden" name="id" value=<%=userId%>> <input
					type="hidden" name="unameOld" value=<%=username%>>


			</form>

		</div>
</body>
</html>
<script>
	function check(form) {
		if (form.uname.value == "") {
			alert("请输入用户名");
			return false;
		}
		if (form.upwd.value == "") {
			alert("请输入密码");
			return false;
		}
		return true;
	}
</script>
